"use strict";
cc._RF.push(module, 'e054f13wvpNrZOOYDkya+6Y', 'LZW');
// scripts/LZW.js

"use strict";

var e = require;
var t = module;
var n = exports;
Object.defineProperty(n, "__esModule", {
  value: !0
});

var o = function () {
  function e() {}

  e.decode = function (e, t) {
    var n = 1 << t,
        o = n + 1,
        i = t + 1,
        a = [],
        r = 0;

    function s() {
      var e;
      a = [];
      i = t + 1;

      for (e = 0; e < n; e++) {
        a[e] = [e];
      }

      a[n] = [];
      a[o] = null;
    }

    function c(t) {
      var n,
          o = 0;

      for (n = 0; n < t; n++) {
        e[r >> 3] & 1 << (7 & r) && (o |= 1 << n);
        r++;
      }

      return o;
    }

    return function () {
      for (var e, t, r = [];;) {
        t = e;

        if ((e = c(i)) != n) {
          if (e == o) break;
          if (e < a.length) t !== n && a.push(a[t].concat(a[e][0]));else {
            if (e !== a.length) throw new Error("LZW解析出错");
            a.push(a[t].concat(a[t][0]));
          }
          r.push.apply(r, a[e]);
          a.length === 1 << i && i < 12 && i++;
        } else s();
      }

      return r;
    }();
  };

  return e;
}();

n["default"] = o;

cc._RF.pop();